<?php 
require_once '../include/includefiles.php';
require_once '../include/userislogin.php';
?>
<?php 
  $query = "select * from siteconfig where id = 1";
  $result = mysql_query($query) or die("查询网站配置失败");
  $row = mysql_fetch_array($result);
  
  if($_POST['sitename']){
  	$sitename = $_POST['sitename'];
  	$keyword  = $_POST['keyword'];
  	$desc = $_POST['desc'];
  	$query = " update siteconfig set ";
  	$query.= " sitename='".$sitename."',";
  	$query.= " keyword='".$keyword."',";
  	$query.= " `desc`='".$desc."'";
  	$query.= " where id = 1";
  	$result = mysql_query($query) or die("更新站点配置失败");
  	if($result){
  		alertmsg("更新站点配置成功");
  	}
  }
  
  
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>网站设置</title>

<link href="images/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="form1" method="post" action="">
  <table width="100%" border="0">
    <tr bgcolor="#E1E5EE">
      <td height="30" colspan="2" align="center"><strong>网站设置</strong></td>
    </tr>
    <tr>
      <td width="34%" height="30" align="right" bgcolor="#F7F8F9">站点名称：</td>
      <td width="66%" height="30" align="left" bgcolor="#F7F8F9"><input value=<?php echo $row['sitename'];?> name="sitename" type="text" id="sitename"></td>
    </tr>
    <tr>
      <td height="30" align="right" bgcolor="#F7F8F9">站点关键字：</td>
      <td height="30" align="left" bgcolor="#F7F8F9"><input name="keyword" type="text" id="keyword" size="60" value=<?php echo $row['keyword'];?>></td>
    </tr>
    <tr>
      <td height="30" align="right" bgcolor="#F7F8F9">站点描述：</td>
      <td height="30" align="left" bgcolor="#F7F8F9"><textarea name="desc" cols="58" rows="4"><?php echo $row['desc'];?></textarea></td>
    </tr>
    <tr>
      <td height="30" colspan="2" align="center" bgcolor="#F7F8F9"><input type="submit" name="Submit" value="确认">
      <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
